import React, { PureComponent } from 'react'
import { createPortal } from 'react-dom'
import Modal from './Modal'

export class App extends PureComponent {
  render() {
    return (
      <div className="app">
        <h1>App h1</h1>
        {createPortal(<h2>App h2</h2>, document.querySelector('#why'))}

        {/* Modal组件 */}
        <Modal>
          <h1>我是标题</h1>
          <p>我是子元素</p>
        </Modal>
      </div>
    )
  }
}

export default App
